package com.da.util;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import com.espirit.eap.manager.EntityInterceptor;
import com.googlecode.cswish.struts.Initialization;
import com.googlecode.cswish.struts.spring.ObjectFactory;
import com.ra.util.RaConstant;

@Service
@Lazy(value=false)
public class DaSystemStartupManager implements Initialization {

	private static final Log logger = LogFactory.getLog(DaSystemStartupManager.class);
	
	@Resource
	private ObjectFactory objectFactory;
	
	@Override
	public void initSite() {
		logger.debug("Init SystemStartupManager");
		
		// Entiry Interceptor
		EntityInterceptor entityInterceptor = objectFactory.getBean(EntityInterceptor.class, true);
		DaEntityInterceptor interceptor = objectFactory.getBean(DaEntityInterceptor.class, true);
		entityInterceptor.setInterceptor(interceptor);
	}

	@Override
	public String[] getProductName() {
		return new String[] {"da"};
	}
}
